package com.oops.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.oops.model.TGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * TODO: 
 * 
 * @author wuyijie
 * @date 2022/4/16 15:26
 */
@Mapper
public interface TGoodsMapper extends BaseMapper<TGoods> {

    @Update("update t_goods set inventory = inventory-1 where id = #{id}")
    void decrInventory(@Param("id") Long id);

    @Update("update t_goods set inventory = inventory+1 where id = #{id}")
    void incrInventory(@Param("id") Long id);
}
